/*
 * Metaverse Core
 * Copyright (C) 2010 Vyacheslav Vorobyov, All rights reserved.
 * See LICENSE for full license information.
 */
package org.metaverse.warehouse.com;


/**
 * @author vjache
 *
 */
public abstract class ValueConstraint {
	
	public static enum Code
	{
		AND,
		OR,
		EQ,
		NEQ,
		GR,
		LS,
		GRE,
		LSE,
		LIKE,
		NLIKE,
		VAR;
	}
	
	public static interface Visitor
	{
		void on(Conjunction aAnd);
		void on(Disjunction aOr);
		void on(Equals aEq);
		void on(Greater aGr);
		void on(Less aLs);
		void on(Like aLk);
		void on(NotEquals aNe);
		void on(Variable aVar);
	}

	private final Code _code;

	protected ValueConstraint(Code aCode)
	{
		_code = aCode;
	} 

	/**
	 * @return the code
	 */
	public final Code getCode() {
		return _code;
	}
	
	public abstract void visit(Visitor aVisitor);
}
